import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/a.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/widgets/select/mixin/radio_mixin.dart';
import 'package:flutter/material.dart';

class NormalRadio extends StatelessWidget with RadioMixin {
  final bool isSelect;
  final String title;
  final double minWidth;
  final bool isEnable;
  final bool isFix;
  const NormalRadio(
      {Key key,
      this.isSelect,
      this.isFix = false,
      this.title,
      this.isEnable = true,
      this.minWidth})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    Widget text = Text(
      title,
      style: TextStyle(
        color: aceBlackColor,
        fontSize: getSp(16),
        fontWeight: isSelect ? FontWeight.w700 : FontWeight.w400,
        height: 1,
      ),
      overflow: TextOverflow.ellipsis,
      maxLines: 1,
    );
    if (isFix) {
      text = Expanded(child: text);
    }
    return Container(
      constraints: BoxConstraints(
        minWidth: minWidth ?? getDp(110),
      ),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          buildSelectWidget,
          SizedBox(
            width: getDp(12),
          ),
          text
        ],
      ),
    );
  }
}
